package com.mgetool.ui.drawer;

import com.mgetool.ui.util.PointF;


public class ScallingParam {
	//缩放锚点
	public static final int SCALLING_ANCHOR_LEFT = 0x1;
	public static final int SCALLING_ANCHOR_RIGHT = 0X2;
	public static final int SCALLING_ANCHOR_TOP = 0X4;
	public static final int SCALLING_ANCHOR_BOTTOM = 0X8;
	/**
	 * 垂直居中
	 */
	public static final int SCALLING_ANCHOR_V_CENTER = 0X10;
	/**
	 * 水平居中
	 */
	public static final int SCALLING_ANCHOR_H_CENTER = 0X20;
	private PointF scalling;
	private PointF scallingOffset;
	
	private int scallingAnchor;
	
	public ScallingParam(PointF scalling, int scallingAnchor){
		this.scalling = scalling;
		this.scallingAnchor = scallingAnchor;
	}

//	public PointF getScalling() {
//		return scalling;
//	}

	/**
	 * 得到x方向上的缩放比例
	 * @return
	 */
	public float getScallingX(){
		float x = 1f;
		if(scalling != null){
			x = scalling.x;
		}
		if(scallingOffset != null){
			x = x * scallingOffset.x;
		}
		return x;
	}
	
	/**
	 * 得到y方向上的缩放比例
	 * @return
	 */
	public float getScallingY(){
		float y = 1f;
		if(scalling != null){
			y = scalling.y;
		}
		if(scallingOffset != null){
			y = y * scallingOffset.y;
		}
		return y;
	}
	
	public void setScalling(PointF scalling) {
		this.scalling = scalling;
	}

	public int getScallingAnchor() {
		return scallingAnchor;
	}

	public void setScallingAnchor(int scallingAnchor) {
		this.scallingAnchor = scallingAnchor;
	}

	public PointF getScallingOffset() {
		return scallingOffset;
	}

	public void setScallingOffset(PointF scallingOffset) {
		this.scallingOffset = scallingOffset;
	}
	
	
	
}
